package org.rency.crawler.fetch.state;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.rency.crawler.domain.state.FetchStatus;
import org.rency.crawler.fetch.handler.FetchHandler;

/**
 * 描述: ${TODO}<br>
 * 最近修改时间:2017/11/23 11:39<br>
 *
 * @author CaiyuRen
 * @version V1.0
 * @since 2017/11/23 11:39
 */
public class FetchStateCarrier {

  private String            fsId;

  /**
   * 抓取状态名称
   */
  private String            fsName;

  /**
   * 抓取状态码
   */
  private String            fsCode;

  /**
   * 抓取状态
   */
  private FetchStatus       fsStatus;

  /**
   * 抓取状态服务
   */
  private FetchHandler      fsService;

  /**
   * 抓取状态描述
   */
  private String            fsDescription;

  private int               retryTimes;

  public String getFsId() {
    return fsId;
  }

  public void setFsId(String fsId) {
    this.fsId = fsId;
  }

  public String getFsName() {
    return fsName;
  }

  public void setFsName(String fsName) {
    this.fsName = fsName;
  }

  public String getFsCode() {
    return fsCode;
  }

  public void setFsCode(String fsCode) {
    this.fsCode = fsCode;
  }

  public FetchStatus getFsStatus() {
    return fsStatus;
  }

  public void setFsStatus(FetchStatus fsStatus) {
    this.fsStatus = fsStatus;
  }

  public FetchHandler getFsService() {
    return fsService;
  }

  public void setFsService(FetchHandler fsService) {
    this.fsService = fsService;
  }

  public String getFsDescription() {
    return fsDescription;
  }

  public void setFsDescription(String fsDescription) {
    this.fsDescription = fsDescription;
  }

  public int getRetryTimes() {
    return retryTimes;
  }

  public void setRetryTimes(int retryTimes) {
    this.retryTimes = retryTimes;
  }

  public void addRetryTimes() {
    this.retryTimes++;
  }

  @Override
  public String toString() {
    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
  }
}
